from gibe.plugin import Plugin

from gibethemenxsy2008.widgets import *
import cherrypy

class GibeThemeNxsy2008Plugin(Plugin):
    def enabled(self):
        return bool(cherrypy.config.get('gibe.theme', None) == "nxsy2008")

    def template_search_path(self, blog, search_path):
        import gibethemenxsy2008.templates
        search_path.insert(0, gibethemenxsy2008.templates.__path__[0])

    def template_data(self, blog, template_data):
        td = {
            'gibethemenxsy2008': GibeThemeNxsy2008,
        }
        template_data.update(td)

    def template_replacements(self, blog, template_replacements):
        template_replacements['genshi:gibe.templates.frontpage'] = 'genshi:gibethemenxsy2008.templates.frontpage'
        template_replacements['genshi:gibe.templates.post'] = 'genshi:gibethemenxsy2008.templates.post'
        template_replacements['genshi:gibe.templates.comment_preview'] = 'genshi:gibethemenxsy2008.templates.comment_preview'
        template_replacements['genshi:gibe.templates.archives'] = 'genshi:gibethemenxsy2008.templates.archives'
        pass
